package com.toutoushidao.ssm.exception;

import com.toutoushidao.ssm.dto.ResultEnum;

/**
 * 
 * @author laodun
 *
 */
public class BizException extends RuntimeException {

	private static final long serialVersionUID = 1L;

    private ResultEnum result;

    public BizException(String message) {
        new BizException(ResultEnum.EXCEPTION_SYSTEM, message);
    }

    /**
     * 业务异常，code 为ResultEnum中的state，summary是枚举中对应的消息
     *
     */
    public BizException(ResultEnum result, String message) {
        super(message);
        this.result = result;
    }

    public BizException(ResultEnum result) {
        super("error:"+result.getCode() + ",message:" + result.getMsg());
        this.result = result;
    }

    public ResultEnum getResult() {
        return result;
    }
}
